package com.ruoyi.system.convert;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import com.ruoyi.system.domain.SysDemo;
import com.ruoyi.system.domain.dto.SysDemoDto;
import com.ruoyi.system.domain.vo.SysDemoVo;
import org.mapstruct.factory.Mappers;

import java.util.List;


/**
 * 测试对象 sys_demo转换器
 *
 * @author ruoyi
 * @date 2024-08-23
 */
@Mapper(componentModel = "spring")
public interface SysDemoConvert {
    /**
     * 获取该类自动生成的实现类的实例
     *
     */
    SysDemoConvert INSTANCE =Mappers.getMapper(SysDemoConvert.class);

    /**
     * 这个方法就是用于实现对象属性复制的方法
     *
     * @Mapping 注解 用于定义属性复制规则
     * source 指定源对象属性
     * target指定目标对象属性
     *
     * @param sysDemo 这个参数就是源对象，也就是需要被复制的对象
     * @return 返回的是目标对象，就是最终的结果对象
     */
    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    SysDemoVo SysDemoToSysDemoVo(SysDemo sysDemo);

    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    SysDemoDto SysDemoToSysDemoDto(SysDemo sysDemo);

    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    SysDemo SysDemoDtoToSysDemo(SysDemoDto sysDemoDto);

    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    SysDemo SysDemoVoToSysDemo(SysDemoVo sysDemoVo);

    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    List<SysDemo> SysDemoVoListToSysDemoList(List<SysDemoVo> sysDemoVoList);

    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    List<SysDemo> SysDemoDtoListToSysDemoList(List<SysDemoDto> sysDemoDtoList);

    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    List<SysDemoDto> SysDemoListToSysDemoDtoList(List<SysDemo> sysDemoList);

    @Mappings({
            @Mapping(source = "id", target =  "id"),
            @Mapping(source = "name", target =  "name"),
            @Mapping(source = "createBy", target =  "createBy"),
            @Mapping(source = "createTime", target =  "createTime"),
            @Mapping(source = "updateBy", target =  "updateBy"),
            @Mapping(source = "updateTime", target =  "updateTime"),
            @Mapping(source = "remark", target =  "remark"),
            @Mapping(source = "isDelete", target =  "isDelete"),
    })
    List<SysDemoVo> SysDemoListToSysDemoVoList(List<SysDemo> sysDemoList);

}
